package com.levi.StrategyPattern.Strategy;

import com.levi.StrategyPattern.CashSuper;

/**
 * @author Levi
 * @description :  打折结算的策略类
 * @since 2022/8/31 15:27
 */

public class CashRebate extends CashSuper {
    //    折扣
    private double moneyRebate = 1d;

    //    获取折扣
    public CashRebate(String moneyRebate) {
        this.moneyRebate = Double.parseDouble(moneyRebate);
    }

    @Override
    public double acceptCash(double money) {
        return money * moneyRebate;
    }
}
